<template>
  <div>

    <h1>添加水印</h1>
    <el-upload
      ref="uploadRef"
      class="upload-demo"
      :auto-upload="false"
      multiple
      :action="imgs"
      :before-upload="beforeUpload"
    >
      <template #trigger>
        <el-button type="primary">选择</el-button>
      </template>

      <el-button class="ml-5" type="success" @click="add">
        添加
      </el-button>

      <template #tip>
        <div class="el-upload__tip">
          jpg/png files with a size less than 500kb
        </div>
      </template>
    </el-upload>
  </div>
</template>
<script setup>
import { ref } from "vue"
const imgs = ref([])
const uploadRef = ref(null)
const beforeUpload = (file) => {
  imgs.value.push(file)
  return false
}
const add = () => {
  uploadRef.value.submit()
  // app.addWaterMark(imgs.value)
  // ipcRenderer.send('addWaterMark', imgs.value)
  // remote.dialog.showErrorBox('惆怅长岑长', 'xxxxxxxxxxxxxxxxx')
}
</script>